#ifndef MULTICASTCLIENT_H
#define MULTICASTCLIENT_H

#include "../Common/Socket.h"
#include "../Common/AudioSystem.h"
#include "../Common/Runnable.h"

#define BUFSIZE 8192
#define HEADERSIZE 23

#define MCPORT 9035

/*-------------------------------------------------------------------------------------------
--
--	CLASS: MulticastClient
--
--	Date: March 25, 2010
--
--	REVISIONS (Date and Description):
--
--	DESIGNER: Brad Paugh, Renz Barron
--
--	PROGRAMMER: Brad Paugh, Renz Barron
--
--  INTERFACE: class MulticastClient : public Runnable
--
--  RETURNS: N/A
--
--	NOTES: Program class for the Multicast Client. Responsible for receiving sound packets
--         off of the multicast stream and processing it to be played.
--
-------------------------------------------------------------------------------------------*/
class MulticastClient : public Runnable
{
	public:
		MulticastClient();
		void receivePacket(char* buffer, int packetSize);
		void receiveFromStream(bool saveFile);
		void run();
		void stop();
		void start();
        void close();
        AudioSystem * getAudioSystem();
	
	private:
		Socket sock;
		bool saveFile;
		bool stopped;
        bool closed;
        AudioSystem as;
};

#endif
